package com.linux.huhx.thread3.reentrantLock_1;

/**
 * @Author: huhx
 * @Date: 2017-10-30 下午 2:59
 */
public class ReentrantLockTest {
    public static void main(String[] args) {
        MyService myService = new MyService();
        new MyThread(myService).start();
        new MyThread(myService).start();
        new MyThread(myService).start();
        new MyThread(myService).start();
        new MyThread(myService).start();
    }
}

class MyThread extends Thread {
    private MyService myService;

    public MyThread(MyService myService) {
        super();
        this.myService = myService;
    }

    @Override
    public void run() {
        myService.testMethod();
    }
}
